package 预习的;

public class 多个数求最大值 {

    public static void main(String[] args) {
        int[] arr1 = {15,45,46,45,78,89,56,23,13};
        getMax(arr1);
    }

    public static void getMax(int[] arr){
        int max= arr[0];
        for (int i = 0; i < arr.length; i++) {
            max = arr[i]>max?arr[i]:max;
        }
        System.out.println("数组的最大值是："+max);
    }
}
